package org.example.codetrail.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.codetrail.pojo.User;
import org.example.codetrail.pojo.UserUseInRepo;

@Mapper
public interface UserMapper {
    @Select("select * from user where username=#{username};")
    UserUseInRepo findByUserName(String username);
    @Insert("insert into user(username,password) values(#{username},#{password});")
    void register(String username, String password);
    @Update("update user set avatar=#{avatar},email=#{email},phone=#{phone},gender=#{gender},age=#{age},tags=#{tags},biography=#{biography},access_token=#{accessToken} where id=#{id}")
    void update(UserUseInRepo uuir);
}
